<#import "../macro/components.ftl" as components/>
<#include "../macro/layout_default.ftl"/>

<@head>
<link rel="stylesheet" href="/misc/app/css/product_list.css"/>
</@head>

<@body>
<script src="/misc/app/js/qrcode_list_group.js"></script>
</@body>

<@layout_default>
<div class="box">
    <div class="box-header with-border">
        <span class="pull-right text-muted">共 ${pagelist.resultTotal} 条记录</span>
        <input type="hidden" id="resultTotal_hidden" value=" ${pagelist.resultTotal}" />
        <form class="form-inline"  name="form_search" action="/qrcodegroup">
            <div class="input-group">
                <div class="input-group-addon">组合码批次：</div>
                <input type="text" class="form-control" style="width: 200px" name="qcname" value="${qcname!}" 
                placeholder="组合码批次"/>
            </div>
               <div class="input-group">
                <div class="input-group-addon">二维码规格：</div>
                 <select class="form-control" id="_pbcid" name="pbcId">
                 			<option value="">请选择</option>
              				<#list listpbc as item>
                           	 	<option value='${item.pcount}' <#if (pbcId!0)?number==item.pcount >  selected="selected" </#if>    >1*${item.pcount}</option>
                             </#list>
                 </select>
            </div>

              <div class="input-group">
                <div class="input-group-addon">打 印：</div>
                <select class="form-control" name="is_print">
                    <option value="">全部</option>
                    <option value="1" ${(is_print?exists && is_print == "1")?string("selected","")}>是</option>
                    <option value="0" ${(is_print?exists && is_print == "0")?string("selected","")}>否</option>
                </select>
            </div>
            <br>
            <br>
             <div class="input-group">
                <div class="input-group-addon">总 数 量：</div>
                <input type="text" class="form-control" style="width: 70px" name="tsno" value="${tsno!}" 
                placeholder="小"/><input type="text" class="form-control" style="width: 70px" name="teno" value="${teno!}" 
                placeholder="大"/>
            </div>
            
             <div class="input-group">
                <div class="input-group-addon">已 扫 量：</div>
                <input type="text" class="form-control" style="width: 70px" name="ysno" value="${ysno!}" 
                placeholder="小"/>
                 <input type="text" class="form-control" style="width: 70px" name="yeno" value="${yeno!}" 
                placeholder="大"/>
            </div>
  			<br>
            <br>
			  <div class="input-group">
                <div class="input-group-addon">箱码数量：</div>
                <input type="text" class="form-control" style="width: 70px" name="xsno" value="${xsno!}" 
                placeholder="小"/><input type="text" class="form-control" style="width: 70px" name="xeno" value="${xeno!}" 
                placeholder="大"/>
            </div>
            
              <div class="input-group">
                <div class="input-group-addon">瓶码/盒码数量：</div>
                <input type="text" class="form-control" style="width: 70px" name="psno" value="${psno!}" 
                placeholder="小"/><input type="text" class="form-control" style="width: 70px" name="peno" value="${peno!}" 
                placeholder="大"/>
            </div>

            <button type="submit" class="btn btn-warning"><i class="fa fa-search"></i> 查询</button>
            <button type="button" id="search_reset" class="btn btn-warning"><i class="fa "></i> 重置</button>
            <button type="button" class="btn btn-default" name="btn_new" data-toggle="modal" data-target="#md_new"><i class="fa fa-plus"></i> 生成组合二维码</button>
        </form>
        <form class="form-inline hide">
            <input class="form-control"/>
            <input type="email" class="form-control"/>
            <button type="submit" class="btn btn-default">Send invitation</button>
        </form>
    </div>

    <!-- /.box-header -->
    <div class="box-body">
        <table class="table table-striped table-hover">
            <tr>
                <th>ID</th>
                <th>组合码批次</th>
                <th>二维码规格</th>
                <th>开始编号</th>
                <th>结束编号</th>
                <th>类型</th>
                <th>总数量</th>
                <th>绑定量</th>
                <th>已扫量</th>
                <th>生成时间</th>
                <th>操作人</th>
                <th>是否打印</th>
                <th>操作</th>
            </tr>
            <#list pagelist.result as item>
                <tr >
                    <td style="vertical-align:middle;">${item.id}</td>
                    <td style="vertical-align:middle;">${item.qcname}</td>
                    <td style="vertical-align:middle;">1*${item.pbc_id}</td>
                    <td style="vertical-align:middle;">${item.gminid!}<hr>${item.minid!}</td>
                    <td style="vertical-align:middle;">${item.gmaxid!}<hr>${item.maxid!}</td>
                    <td style="vertical-align:middle;"><span class="text-yellow">箱码</span><hr><span class="text-green">瓶码/盒码</span></td>
                    <td style="vertical-align:middle;">${item.gtotal!}<hr>${item.total!}</td>
                    <td style="vertical-align:middle;">${item.gbd!0}<hr>${item.bd!}</td>
                    <td style="vertical-align:middle;">${item.gscan_nub!}<hr>${item.scan_nub!}</td>
                    <td style="vertical-align:middle;">${item.c_time?number_to_datetime}</td>
                    <td style="vertical-align:middle;">${item.c_admin!}</td>
                    <td style="vertical-align:middle;"><#if item.is_print==true><span class="text-green">是</span><#elseif item.is_print==false><span class="text-yellow">否</span><#else><span class="text-danger">未知</span></#if></td>
                    <td style="vertical-align:middle;">
                     
                       <button type="button" class="btn btn-default btn-xs" name="see_binding" onclick="window.location.href='/qrcodegroup/binding?id=${item.id?c}'">绑定分布</button>
                      
                        <button type="button" class="btn btn-default btn-xs" name="see_detail" onclick="window.location.href='/qrcodegroup/detail?id=${item.id?c}'">明细</button>
                       
                        <button type="button" class="btn btn-default btn-xs" name="btn_down" data-id="${item.id?c}" data-qcname="${item.qcname}">下载</button>
                        
                        <button type="button" class="btn btn-default btn-xs" name="btn_shortdown" data-id="${item.id?c}" data-qcname="${item.qcname}">短地址下载</button>

                        <#--<button type="button" class="btn btn-default btn-xs btn_down_image"  data-id="${item.id?c}" data-qcname="${item.qcname}">下载图片</button>-->
                    </td>
                </tr>
            </#list>
        </table>
        <table class="table table-striped table-hover">
        	<tr>
        		<td colspan="13" style="text-align:right;background-color:white;">
        			<a href="javascript:void(0);"  name="btn_qrcodegroup_export"><i class="glyphicon glyphicon-save"></i> 数据导出</a>
        		</td>
        	</tr>
        </table>
    </div>
    <!-- /.box-body -->
    <div class="box-footer text-center">
       <@components.pagination "${pagelist.rquesturl}&page=$page",pagelist.page,pagelist.pageTotal/>
    </div>
</div>


<!--=========== Modals =============-->
<!-- md_new -->
<div class="modal" id="md_new" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title"><i class="fa fa-plus"></i> 生成组合二维码</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" name="form_new">
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><strong class="text-red bold"> *</strong> 组合码批次</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" placeholder="组合码批次" name="qcname"/>
                        </div>
                    </div>
                   <div class="form-group">
                        <label class="col-sm-2 control-label"><strong class="text-red bold"> *</strong> 二维码规格</label>
                        <div class="col-sm-10">
                            <select class="form-control" id="_pbcid_two" name="pbcId">
                                <option value="">请选择二维码规格</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label"><strong class="text-red bold"> *</strong> 箱码数量</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="_nbsid"  placeholder="生成的二维码箱码数量" name="nubs"/>
                        </div>
                    </div>
                    
                       <div class="form-group">
                        <label class="col-sm-2 control-label"><strong class="text-red bold"> *</strong> 瓶码/盒码数量</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="_autonbsid" placeholder="根据规格和箱码数量自动生成"  readonly/>
                        </div>
                    </div>
                   
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" id="btn_new_save_qrcode" class="btn btn-primary" name="btn_new_save_qrcode">批量生成</button>
            </div>
        </div>
    </div>
</div>


</@layout_default>